home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-05-05 | 3.6 KB | 139 lines | [TEXT/MPS ] |
-
- #----------------------------------------------------------------------------
- #
- # NAME
- # vuCollect -- Reformat Descriptor window information to a readable
- # multi-line format.
- #
- # VERSION: 1.0b1
- #
- # SYNOPSIS
- #
- # vuCollect -t "TargetName" [-d "DescriptorTrait"]
- #
- # AUTHOR K. Landreth MS 35-BD
- #
- # DESCRIPTION
- # vuCollect is an MPW script which calls Virtual User for the specified target,
- # collects descriptor information, and then pipes that output to an MPW tool
- # "vuFormatter" which in turn converts the descriptor information to a
- # multi-line format instead of the single-line format normally given by VU.
- # This structured format makes the descriptor information very readable and is
- # also handy for documenting various information about an application and its
- # corresponding VU scripts.
- #
- # The default descriptor trait used is "window"; however using the -d command,
- # the user can specify whatever descriptor trait he/she wishes. (e.g.:
- #
- # vucollect -t "*:myTarget" -d "menu" > myFile
- #
- # would specify to output to "myFile" the menu descriptors for myTarget machine
- # in a readable multi-line format.
- #
- # vuCollect must have "VU" and the secondary tool "vuFormatter" accessible;
- # therefore you should place all three files in the MPW Tools folder or in a
- # folder which is accessible to your current working directory.
- #
- # vuCollect makes use of the VU menu script (if installed - see VU docs)
- # and its associated default variables for zones, targets, etc. After
- # "Pick Target" is selected from VU menu, you could simply type:
- #
- # vucollect
- #
- # vuFormatter will output window descriptors with additional information
- # about descriptors' sizes and relative location within each window.
- # See 'ReadMe' file.
- #
- # HISTORY 06/26/90 - Created.
- # 08/22/90 - Take out output file option.
- # - vu optional output to "vuCollectTemp"
- # - Redirect vu Err/output to "Dev:Null".
- # 08/24/90 - Added support for VU menu and default variables.
- # - Delete need for one temporary file.
- # 02/20/91 - Allow for single quotes in chooser name.
- #
- # COPYRIGHT
- # Copyright Apple Computer, Inc. 1990
- # All rights reserved.
- #
- #-----------------------------------------------------------------------------
-
-
-
- set cmd "{0}"
- set desTypeFlag 0
- set desTypeOpt 0
- set desType "window"
- set targetFlag 0
- set targetOpt 0
- set vuArgs ""
- set usage '# Usage: vuCollect -t TargetName ∂[-d DescriptorSpec∂].'
-
-
- # process parameters
- for Parm in {"Parameters"}
- if {targetFlag}
- if "{Parm}" =~ /-≈/
- echo "# -t option used without target name."
- echo {usage}
- exit 1
- else
- set targetFlag 0
- set targetOpt 1
- set vuArgs "{vuArgs} -t ∂"{Parm}∂""
- end
-
- else if {desTypeFlag}
- if "{Parm}" =~ /-≈/
- echo "# -d option used without Descriptor type."
- echo {usage}
- exit 1
- else
- set desTypeFlag 0
- set desTypeOpt 1
- set desType "{Parm}"
- end
-
- else if "{Parm}" =~ /-t/
- set targetFlag 1
-
- else if "{Parm}" =~ /-d/
- set desTypeFlag 1
-
- else if "{Parm}" =~ /-≈/
- echo "# invalid option ∂'{Parm}∂'."
- echo {usage}
- exit 1
- end
- end
-
-
- if {desTypeFlag}
- echo "# -d option used without Descriptor type."
- echo {usage}
- exit 1
-
- else if {targetFlag}
- echo "# -t option used without target name."
- echo {usage}
- exit 1
-
- else if !{targetOpt}
- if "{VUTargetName}" == ""
- echo "# -t option required to specify target."
- echo {usage}
- exit 1
- else
- set vuArgs "{vuArgs} -t '{VUTargetZone}:{VUTargetName}'"
- end
- end
-
-
- echo "println collect[{desType}];" | vu {vuArgs} -o vuCollectTemp > "Dev:Null"
-
-
- vuFormatter vuCollectTemp
-
- delete -y vuCollectTemp
-
-